<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      th:replace="fragments/layout(title='从业人员信息-编辑',jsPaths='/static/js/baseinfo/employee/edit.js')">
<div class="right" th:fragment="right">
    <!--面包屑-->
    <div class="breadcrumb layui-bg-gray">
                <span class="layui-breadcrumb" lay-separator=">">
                    <a th:href="@{/}">首页</a>
                    <a href="">人事管理</a>
                    <a href="/employee">从业人员</a>
                    <a><cite>编辑</cite></a>
                </span>
    </div>
    <!--主体内容区-->
    <div class="form-content layui-container">

        <form class="layui-form">

            <div class="layui-row">
                <div class="layui-col-md8">
                    <div class="layui-row">
                        <div class="layui-col-md6">
                            <div class="layui-form-item">
                                <label class="layui-form-label must">姓名</label>
                                <div class="layui-input-block">
                                    <input type="hidden" name="id" th:value="${employee.id}" autocomplete="off"
                                           class="layui-input">
                                    <input type="text" name="name" th:value="${employee.name}" lay-verify="required"
                                           maxlength="10" placeholder="请输入姓名"
                                           autocomplete="off" class="layui-input">
                                </div>
                            </div>
                        </div>
                        <div class="layui-col-md6">
                            <div class="layui-form-item">
                                <label class="layui-form-label must">身份证号</label>
                                <div class="layui-input-block">
                                    <input type="text" name="idNo" id="idNo" lay-verify="identity" placeholder="请输入身份证号码"
                                           autocomplete="off"
                                           class="layui-input" th:value="${employee.idNo}">
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-row">
                        <div class="layui-col-md6">
                            <div class="layui-form-item">
                                <label class="layui-form-label must">性别</label>
                                <div class="layui-input-block">
                                    <select name="gender">
                                        <option value="0" th:selected='${employee.gender} eq 0'>男</option>
                                        <option value="1" th:selected='${employee.gender} eq 1'>女</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="layui-col-md6">
                            <div class="layui-form-item">
                                <label class="layui-form-label must">生日</label>
                                <div class="layui-input-block">
                                    <input type="text" name="birthday" id="birthday" placeholder="请输入出生年月日"
                                           autocomplete="off"
                                           readonly="readonly" class="layui-input" lay-verify="required "
                                           th:value="${#dates.format(employee.birthday, 'yyyy-MM-dd')}">
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="layui-row">
                        <div class="layui-col-md6">
                            <div class="layui-form-item">
                                <label class="layui-form-label">民族</label>
                                <div class="layui-input-block">
                                    <input type="text" name="nation" placeholder="请输入民族" autocomplete="off"
                                           class="layui-input"
                                           th:value="${employee.nation}">
                                </div>
                            </div>
                        </div>
                        <div class="layui-col-md6">
                            <div class="layui-form-item">
                                <label class="layui-form-label">婚姻状况</label>
                                <div class="layui-input-block">
                                    <select name="maritalStatus">
                                        <option value="0" th:selected='${employee.maritalStatus} eq 0'>未婚</option>
                                        <option value="1" th:selected='${employee.maritalStatus} eq 1'>已婚</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-row">
                        <div class="layui-col-md6">
                            <div class="layui-form-item">
                                <label class="layui-form-label">政治面貌</label>
                                <div class="layui-input-block">
                                    <select name="politicsStatus">
                                        <option value="0" th:selected='${employee.politicsStatus} eq 0'>群众</option>
                                        <option value="1" th:selected='${employee.politicsStatus} eq 1'>中共党员</option>
                                        <option value="2" th:selected='${employee.politicsStatus} eq 2'>中共预备党员</option>
                                        <option value="3" th:selected='${employee.politicsStatus} eq 3'>共青团员</option>
                                        <option value="4" th:selected='${employee.politicsStatus} eq 4'>民革党员</option>
                                        <option value="5" th:selected='${employee.politicsStatus} eq 5'>民盟盟员</option>
                                        <option value="6" th:selected='${employee.politicsStatus} eq 6'>民建会员</option>
                                        <option value="7" th:selected='${employee.politicsStatus} eq 7'>民进会员</option>
                                        <option value="8" th:selected='${employee.politicsStatus} eq 8'>农工党党员</option>
                                        <option value="9" th:selected='${employee.politicsStatus} eq 9'>致公党党员</option>
                                        <option value="10" th:selected='${employee.politicsStatus} eq 10'>九三学社社员
                                        </option>
                                        <option value="11" th:selected='${employee.politicsStatus} eq 11'>无党派人士</option>
                                        <option value="12" th:selected='${employee.politicsStatus} eq 12'>台盟盟员</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="layui-col-md6">
                            <div class="layui-form-item">
                                <label class="layui-form-label">文化程度</label>
                                <div class="layui-input-block">
                                    <select name="culture">
                                        <option value="0" th:selected='${employee.culture} eq 0'>研究生</option>
                                        <option value="1" th:selected='${employee.culture} eq 1'>博士</option>
                                        <option value="2" th:selected='${employee.culture} eq 2'>大学本科</option>
                                        <option value="3" th:selected='${employee.culture} eq 3'>大学专科</option>
                                        <option value="4" th:selected='${employee.culture} eq 4'>中等专业学校</option>
                                        <option value="5" th:selected='${employee.culture} eq 5'>技工学校</option>
                                        <option value="6" th:selected='${employee.culture} eq 6'>高中</option>
                                        <option value="7" th:selected='${employee.culture} eq 7'>初中</option>
                                        <option value="8" th:selected='${employee.culture} eq 8'>小学</option>
                                        <option value="9" th:selected='${employee.culture} eq 9'>文盲</option>
                                        <option value="10" th:selected='${employee.culture} eq 10'>半文盲</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="layui-row">
                        <div class="layui-col-md6">
                            <div class="layui-form-item">
                                <label class="layui-form-label must">联系电话</label>
                                <div class="layui-input-block">
                                    <input type="text" name="contactPhone" placeholder="请输入联系电话" autocomplete="off"
                                           class="layui-input" lay-verify="phone"
                                           th:value="${employee.contactPhone}">
                                </div>
                            </div>
                        </div>
                        <div class="layui-col-md6">
                            <div class="layui-form-item">
                                <label class="layui-form-label">紧急联系人电话</label>
                                <div class="layui-input-block">
                                    <input type="text" name="urgencyContactPhone" placeholder="请输入紧急联系人电话" autocomplete="off" class="layui-input" th:value="${employee.urgencyContactPhone}">
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-col-md3" style="padding-left:10px;">
                    <div style="width: 150px;height: 174px;background: floralwhite;text-align: center;line-height: 174px;">
                        <img th:if="${employee.avatar==null || employee.avatar=='' }" src="/static/imgs/txsc.png"
                             alt="头像"
                             id="avatarimg" style="cursor: pointer;">
                        <img th:if="${employee.avatar !=null &&  employee.avatar !='' }"
                             th:src="@{'/storage/files/'+${employee.avatar}}" alt="头像" id="avatarimg"
                             style="cursor: pointer;">
                        <input type="hidden" id="avatar" name="avatar" th:value="${employee.avatar}">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">暂住地址</label>
                <div class="layui-input-block">
                    <input type="text" name="temporaryAddress" required placeholder="请输入暂住地址" autocomplete="off"
                           class="layui-input" th:value="${employee.temporaryAddress}">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">家庭地址</label>
                <div class="layui-input-block">
                    <input type="text" name="homeAddress" placeholder="请输入家庭地址" autocomplete="off" class="layui-input"
                           th:value="${employee.homeAddress}">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label must ">所属部门</label>
                    <div class="layui-input-block">
                        <select name="departmentId" lay-filter="department">
                            <option th:each="dep: ${departments}" th:value="${dep.id}" th:text="${dep.name}"
                                    th:selected="${employee.departmentId} eq ${dep.id}"></option>
                        </select>
                        <input type="hidden" name="departmentName" id="departmentName" th:value="${employee.departmentName}">
                    </div>
                </div>
                <div class="layui-inline">
                    <div class="layui-form-item">
                        <label class="layui-form-label must">岗位</label>
                        <div class="layui-input-block">
                            <select name="type" lay-verify="required" lay-filter="post">
                                <option value=""></option>
                                <option value="1" th:selected='${employee.type} eq 1'>医生</option>
                                <option value="2" th:selected='${employee.type} eq 2'>护士</option>
                                <option value="4" th:selected='${employee.type} eq 4'>护工</option>
                                <option value="6" th:selected='${employee.type} eq 6'>消防</option>
                                <option th:each="post: ${posts}" th:value="${post.id}" th:text="${post.name}"
                                        th:selected='${employee.type} eq ${post.id}'></option>
                            </select>
                            <input type="hidden" name="postName" id="postName" th:value="${employee.postName}">
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">职称级别</label>
                <div class="layui-input-block">
                    <select name="jobTitle" lay-filter="type">
                        <option value="0" th:selected='${employee.jobTitle} eq 0'>无</option>
                        <option value="1" th:selected='${employee.jobTitle} eq 1'>一级护理</option>
                        <option value="2" th:selected='${employee.jobTitle} eq 2'>二级护理</option>
                        <option value="3" th:selected='${employee.jobTitle} eq 3'>三级护理</option>
                        <option value="4" th:selected='${employee.jobTitle} eq 4'>特级护理</option>
                        <option value="5" th:selected='${employee.jobTitle} eq 5'>初级医师</option>
                        <option value="6" th:selected='${employee.jobTitle} eq 6'>中级医师</option>
                        <option value="7" th:selected='${employee.jobTitle} eq 7'>副高级医师</option>
                        <option value="8" th:selected='${employee.jobTitle} eq 8'>正高级医师</option>
                        <option value="9" th:selected='${employee.jobTitle} eq 9'>初级护士</option>
                        <option value="10" th:selected='${employee.jobTitle} eq 10'>初级护师</option>
                        <option value="11" th:selected='${employee.jobTitle} eq 11'>主管护师</option>
                        <option value="12" th:selected='${employee.jobTitle} eq 12'>主任护师</option>
                        <option value="13" th:selected='${employee.jobTitle} eq 13'>初级建(构)筑物消防员</option>
                        <option value="14" th:selected='${employee.jobTitle} eq 14'>中级建(构)筑物消防员</option>
                        <option value="15" th:selected='${employee.jobTitle} eq 15'>高级建(构)筑物消防员</option>
                        <option value="16" th:selected='${employee.jobTitle} eq 16'>建(构)筑物消防技师</option>
                        <option value="17" th:selected='${employee.jobTitle} eq 17'>建(构)筑物消防高级技师</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">身份证附件</label>
                    <div class="layui-input-block">
                        <div style="position: relative;margin-left:10px;width: 200px;height: 150px;background: floralwhite;text-align: center;line-height: 174px;">
                            <img th:if="${employee.identityCardJust==null|| employee.identityCardJust==''}"
                                 src="/static/imgs/sfzz.png" alt="身份证正面" id="identityCardJust"
                                 style="cursor: pointer;height: 160px;width: 200px;">
                            <img th:if="${employee.identityCardJust !=null &&  employee.identityCardJust!=''}"
                                 th:src="@{'/storage/files/'+${employee.identityCardJust}}" alt="身份证正面"
                                 id="identityCardJust" style="cursor: pointer;height: 160px;width: 200px;">
                            <input type="hidden" name="identityCardJust" class="identityCardJust">
                        </div>
                    </div>
                </div>
                <div class="layui-inline">
                    <div class="layui-input-block">
                        <div style="position: relative;margin-left:10px;width: 200px;height: 150px;background: floralwhite;text-align: center;line-height: 174px;">
                            <img th:if="${employee.identityCardAgainst==null || employee.identityCardAgainst==''}"
                                 src="/static/imgs/sfzf.png" alt="身份证反面" id="identityCardAgainst"
                                 style="cursor: pointer;height: 160px;width: 200px">
                            <img th:if="${employee.identityCardAgainst!=null && employee.identityCardAgainst !=''}"
                                 th:src="@{'/storage/files/'+${employee.identityCardAgainst}}" alt="身份证反面"
                                 id="identityCardAgainst" style="cursor: pointer;height: 160px;width: 200px">
                            <input type="hidden" name="identityCardAgainst" class="identityCardAgainst">
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item" id="uploadLaborContract">
                <label class="layui-form-label ">劳动合同</label>
                <div class="layui-input-block">
                    <div class="layui-inline layui-upload" th:each="laborContract:${laborContractArray}">
                        <img style="height: 150px;width: 110px" th:data-src="${laborContract}" class="layui-upload-img"
                             th:src="@{'/storage/images/'+${laborContract}+'_150x110'}">
                        <p class="msg-box">
                              <button type="button" class="layui-btn layui-btn-danger  layui-btn-xs deleteLaborContract">删除</button>
                        </p>
                    </div>
                    <div class="layui-upload layui-inline" id="laborContracts">
                        <div class="layui-upload-list">
                            <img  style="height: 150px;width: 110px" class="layui-upload-img" src="/static/imgs/imgup.png" id="laborContract1">
                            <p class="msg-box" style="visibility: hidden">
                                <button type="button" class="layui-btn layui-btn-danger  layui-btn-xs deleteLaborContract">删除</button>
                            </p>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label ">证书信息</label>
                <div class="layui-input-block" style="line-height: 36px;">
                    <a href="javascript:void(0)" id="certificateAdd" class="layui-btn layui-btn-normal layui-btn-xs">添加证书</a>
                </div>
                <table class="layui-table" lay-size="sm">
                    <colgroup>
                        <col width="150">
                        <col width="200">
                        <col>
                    </colgroup>
                    <thead>
                    <tr>
                        <th>证书名称</th>
                        <th>证书图片</th>
                        <th width="20px">操作</th>
                    </tr>
                    </thead>
                    <tbody id="tbody">
                    <tr th:each="cert:${certs}">
                        <td class="certificateName" th:text="${cert.name}"></td>
                        <td class="certificateImg">
                            <img class="layui-upload-img" th:data-imgsrc="${cert.path}"
                                 th:src="@{'/storage/files/'+${cert.path}}">
                            <p class="msg-box">
                                <a target="_blank" th:href="@{'/storage/files/'+${cert.path} }"
                                   class="layui-btn layui-btn-normal layui-btn-xs">查看</a>
                                <a th:href="@{'/storage/files/dl/'+${cert.path} }"
                                   class="layui-btn layui-btn-normal  layui-btn-xs">下载</a>
                            </p>
                        </td>
                        <td>
                            <button type="button" class="layui-btn layui-btn-sm delete">删除</button>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label ">培训记录</label>
                <div class="layui-input-block" style="line-height: 36px;">
                    <a href="javascript:void(0)" id="trainAdd"
                       class="layui-btn layui-btn-normal layui-btn-xs">添加培训记录</a>
                </div>
                <table class="layui-table" lay-size="sm">
                    <colgroup>
                        <col width="150">
                        <col width="200">
                        <col>
                    </colgroup>
                    <thead>
                    <tr>
                        <th>培训名称</th>
                        <th>培训时间</th>
                        <th>培训单位</th>
                        <th>培训成绩</th>
                        <th>培训证明</th>
                        <th width="99px">操作</th>
                    </tr>
                    </thead>
                    <tbody id="tbody1">
                    <tr th:each="train:${trains}">
                        <td class="trainName" th:text="${train.trainName}"></td>
                        <td class="trainDate" th:text="${#dates.format(train.trainDate, 'yyyy-MM-dd')}"></td>
                        <td class="trainOrganization" th:text="${train.trainOrganization}"></td>
                        <td class="trainGrade" th:text="${train.trainGrade}"></td>
                        <td style="height: 137px">
                            <div style="float: left"  th:if="${ train.trainImg1 !=null && train.trainImg1 !=''}">
                                <img class="layui-upload-img" th:src="@{'/storage/files/'+${train.trainImg1}}">
                                <p class="msg-box">
                                    <a target="_blank" th:href="@{'/storage/files/'+${train.trainImg1}}" class="layui-btn layui-btn-normal layui-btn-xs">查看</a>
                                    <a th:href="@{'/storage/files/dl/'+${train.trainImg1}}" class="layui-btn layui-btn-normal  layui-btn-xs">下载</a>
                                </p>
                            </div>
                            <div style="float: left"  th:if="${ train.trainImg2 !=null && train.trainImg2 !=''}">
                                <img class="layui-upload-img" th:src="@{'/storage/files/'+${train.trainImg2}}">
                                <p class="msg-box">
                                    <a target="_blank" th:href="@{'/storage/files/'+${train.trainImg2}}" class="layui-btn layui-btn-normal layui-btn-xs">查看</a>
                                    <a th:href="@{'/storage/files/dl/'+${train.trainImg2}}" class="layui-btn layui-btn-normal  layui-btn-xs">下载</a>
                                </p>
                            </div>

                        </td>
                        <td>
                            <button type="button" class="layui-btn layui-btn-sm delete1">删除</button>
                        </td>
                        <input type="hidden" name="trainImg" class="trainImg" id="uploadOneImg"
                               th:value="${train.trainImg1}">
                        <input type="hidden" name="trainImg" class="trainImg" id="uploadTwoImg"
                               th:value="${train.trainImg2}">
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="layui-col-lg5">
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn  layui-btn-normal" lay-submit lay-filter="submitBtn">保存</button>
                        <a href="/employee" class="layui-btn layui-btn-primary">返回</a>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>
</html>